package org.me.app.student;

import java.util.ArrayList;
import java.util.List;

import org.me.app.R;
import org.me.app.R.id;
import org.me.app.R.layout;
import org.me.bean.Announcement;
import org.me.bean.CourseSchedule;
import org.me.bean.Student;
import org.me.bean.StudentData;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class StudentProfileActivity extends Activity {

	public static final String log_tag = "StudentProfileActivity";
	private TextView tvStudentName;
	private TextView tvStudentId;
	private TextView tvSchool;
	private Button btn_showSche;
	StudentData stuData = new StudentData();

	ArrayList<org.me.bean.CourseSchedule> courseList = new ArrayList<org.me.bean.CourseSchedule>();
	ArrayList<org.me.bean.Announcement> annList = new ArrayList<org.me.bean.Announcement>();
	
	Student student = new Student();

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.studentinfor);

		tvStudentId = (TextView) findViewById(R.id.tv_studentid);
		tvStudentName = (TextView) findViewById(R.id.tv_studentname);
		tvSchool = (TextView) findViewById(R.id.tv_school);

		Bundle b = getIntent().getExtras();
		stuData = (StudentData) b.getParcelable("org.me.bean.StudentData");

		student = stuData.getStudent();
		courseList = (ArrayList<CourseSchedule>) stuData.getCourseList();
		

		tvStudentId.setText(student.getStudentId());
		tvStudentName.setText(student.getStudentName());
		tvSchool.setText(student.getSchoolName());

		btn_showSche = (Button) findViewById(R.id.btn_showschedule);
		btn_showSche.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View arg0) {

				Intent i = new Intent(getApplicationContext(),
						ScheduleListActivity.class);
				// i.putParcelableArrayListExtra("AnnList", annList);
				i.putExtra("Student", student);
				i.putParcelableArrayListExtra("CourseList", courseList);
				startActivity(i);

			}
		});

	}

}
